<?php

echo '<div class="center_text top">';
echo $this->pagination->create_links();
echo '</div>';

$result = $query->result();

$this->table->add_row(
	'',
	'Title',
	'Price',
	''
);

for($i=$pagination['start']; $i<$pagination['start']+$pagination['length']; $i++)
{
	if(isset($result[$i]))
	{
		$row = $result[$i];
		$this->table->add_row(
			'<img src="'.base_url().dvd_covers_path().'/'.$row->dvd_cover.'" style="width: 80px;">',
			$row->dvd_title,
			'&pound;'.$row->dvd_price,
			anchor('cart/add/'.$row->dvd_id, 'Add to Cart')
		);
	}
}

$tmpl = array(
	'table_open' => '<table class="center dvds_table" style="margin-top: 10px;">'
);
$this->table->set_template($tmpl);

echo $this->table->generate();